package com.lam.system.listener;

import com.lam.common.components.easyexcel.imp.listener.BaseListener;
import com.lam.common.components.easyexcel.imp.model.ImportWrapper;
import com.lam.system.entity.SysLanguage;
import com.lam.system.entity.imp.SysLanguageImp;
import com.lam.system.service.SysLanguageService;

/**
 * 国际化管理导入读取类 
 * 此类不能单例，要每次读取excel都要new 
 * @author admin
 *
 */
public class UploadSysLanguageListener extends BaseListener<SysLanguageImp, SysLanguage> {
	
	private SysLanguageService sysLanguageService;

	public UploadSysLanguageListener(SysLanguageService sysLanguageService) {
		super(SysLanguageImp.class, SysLanguage.class);
		this.sysLanguageService = sysLanguageService;
	}

	//重新该方法可自定义校验数据
//	@Override
//	protected String checkData(ImportEntry<SysLanguageImp, SysLanguage> wrapper) {
//		//自定义校验数据逻辑
//		return null;
//	}

	@Override
	protected void saveSuccessData(ImportWrapper<SysLanguageImp, SysLanguage> wrapper) {
		
		sysLanguageService.importData(wrapper);
	}


}
